//
// Created by liushuai on 2020/4/2.
//
#include<iostream>
#include<gtest/gtest.h>
#include <math.h>
#include "mySqrt.h"
using namespace std;
TEST(mySqrtTest,NormalFunctionTest){
    // 断言add(1,2)==3的结果为true
    for(int i=0;i<100;i++){
        ASSERT_TRUE(mySqrt(i)==int(sqrt(i)))<<"mySqrt("<<i<<")="<<int(sqrt(i));
    }
    // 超大值测试
    ASSERT_TRUE(mySqrt(2147395599)==int(sqrt(2147395599)));



}
int main(int argc,char **argv){
    ::testing::InitGoogleTest(&argc,argv);
    return RUN_ALL_TESTS();
}